import java.util.Random;
import java.util.Scanner;

public class uu {
    public static void main(String[] args) {
        Random rand = new Random();
        Scanner scanner = new Scanner(System.in);
        int target = rand.nextInt(10);
        boolean isWon = false;
        System.out.println("==== 幸运抽奖游戏 ====");
        for (int attempt = 1; attempt <= 3; attempt++) {
            System.out.printf("第%d次尝试（剩余%d次）\n", attempt, 3 - attempt);
            System.out.print("请输入0-9的数字：");

            int guess = scanner.nextInt();

            if (guess == target) {
                System.out.println("🎉 恭喜中奖！");
                isWon = true;
                break;
            } else if (guess > target) {
                System.out.println("提示：猜大了！");
            } else {
                System.out.println("提示：猜小了！");
            }
        }
        if (!isWon) {
            System.out.println("\n💔 很遗憾未中奖，正确答案是：" + target);
        }
        scanner.close();
    }
}
